package team.central.states;

import org.lwjgl.input.Mouse;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;
import team.central.util.Clickables;

public class Credits extends BasicGameState {
	
	Clickables c = new Clickables();
	
	@SuppressWarnings("unused")
	private int posx = 0;
	@SuppressWarnings("unused")
	private int posy = 0;
	private String mouse = "No input yet.";

	Image Credits;
	
	private int ID = 5;
	public Credits(int ID) {
		this.ID = ID;
	}
	
	@Override
	public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
		Credits = new Image("res/Backgrounds/Credits.png");
	}

	@Override
	public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
		Credits.draw(0,0);
		
		g.drawString(mouse, 650, 10); //REMOVE UPON FINAL RELEASE!!!!	
	}

	@Override
	public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
		c.stateChange(0, 13, 90, 400, 430, gc, sbg);
		
		mouseGetter(gc, sbg);
	}
	public void mouseGetter(GameContainer gc, StateBasedGame sbg) throws SlickException {
		int mouseX = Mouse.getX();
		int mouseY = Math.abs(Mouse.getY() - sbg.getContainer().getHeight()) - 1;
		posx = mouseX;
		posy = mouseY;
		mouse = "X: " + mouseX + " Y: " + mouseY;
	}

	@Override
	public int getID() {
		return ID;
	}

}
